package com.lzy.service;

import com.lzy.spring.*;

//@Component(value = "userService")
@Component
//@Scope(value = "prototype")
@Scope
public class UserService1 implements BeanNameAware, InitializingBean {

	@Autowired
	private OrderService orderService;

	private String beanName; // bean的名字，进行回调赋值

	@Override
	public void setBeanName(String beanName) {
		this.beanName = beanName;
	}

	// 初始化方法
	@Override
	public void afterPropertiesSet() {
		// ...... 做非常多的事情，比如给属性赋值，或者是其他的业务逻辑
		System.out.println("......执行了 afterPropertiesSet() ");
	}

	public void test() {
		System.out.println(orderService);
	}

}
